#!/bin/sh
#proc=OCPro
temp="$HOME/tmp.grep"
proc=OCPro
script_name=`basename "$0"`

if [ "$1" == "h" ]||[ "$1" == "help" ];then
    echo "usage:"
    echo "     $script_name  h/help       print this info"
    echo "     $script_name               use ostool to send 65025 to process OCPro"
    echo "     $script_name  arg          use ostool to send arg to process OCPro"
exit 0
fi
ps -ef | grep  "$proc" | grep `whoami` | grep -v grep  | awk '{print $9}' > $temp

arg=40015

i=0
cat $temp | while read line
 do
     ((++i))
     #echo "File:${line}"
     if (( $# > 0 ));then
         printf "set arg to [%s]\n" "$1"
         arg=$1
     fi

     printf "[%03d] ostool send %s %s\n"  $i "$line" "$arg"
<<<<<<< .mine
     echo y|ostool send $line $arg 4-1800
=======
     echo y|ostool send $line 40015 4-1800 
>>>>>>> .r934
 done

 rm $temp
